package com.bsj.power.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bsj.power.common.def.dto.locationDevice.LocationDevice2DDTO;
import com.bsj.power.common.def.dto.locationDevice.LocationDeviceSearchDTO;
import com.bsj.power.common.def.entity.locationDevice.LocationDevice;
import com.bsj.power.common.def.vo.KeyValueVO;
import com.bsj.power.common.def.vo.pls.Anchor2DInfoVO;
import com.bsj.power.common.def.vo.pls.LocationDeviceVO;
import com.bsj.power.common.def.vo.pls.excel.LocationDeviceTemplate;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author LiJiaXin
 * @version 1.0.0
 * @description LocationDeviceMapper
 * @time 2024/4/19 12:02
 */
public interface LocationDeviceMapper extends BaseMapper<LocationDevice> {

    /**
     * 批量删除定位设备
     *
     * @param ids
     * @return java.lang.Integer
     * @author ljx
     * @time 2024/4/19 15:03
     */
    int batchDelete(@Param("ids") List<Long> ids);

//    /**
//     * 绑定或解绑人员
//     *
//     * @param personnelId
//     * @param deviceId
//     * @return java.lang.Integer
//     * @author ljx
//     * @time 2024/4/19 15:43
//     */
//    int bindOrUnbind(@Param("personnelId") Integer personnelId, @Param("deviceId") Long deviceId);

    /**
     * 统计定位设备数量
     *
     * @param locationDeviceSearchDTO
     * @return long
     * @author ljx
     * @time 2024/4/19 16:17
     */
    long countLocationDevice(LocationDeviceSearchDTO locationDeviceSearchDTO);

    /**
     * 定位设备分页
     *
     * @param locationDeviceSearchDTO
     * @return java.util.List<com.bsj.power.common.def.vo.pls.LocationDeviceVO>
     * @author ljx
     * @time 2024/4/19 16:17
     */
    List<LocationDeviceVO> pageLocationDevice(LocationDeviceSearchDTO locationDeviceSearchDTO);

    /**
     * 模糊搜索
     *
     * @param value
     * @param type
     * @return java.util.List<com.bsj.power.common.def.vo.KeyValueVO>
     * @author ljx
     * @time 2024/5/15 16:12
     */
    List<KeyValueVO> fuzzySearch(@Param("value") String value, @Param("type") Integer type, @Param("deviceType") Integer deviceType);

    /**
     * 批量添加设备
     *
     * @param locationDevices
     * @return java.lang.Integer
     * @author ljx
     * @time 2024/8/9 10:50
     */
    Integer batchAdd(@Param("locationDevices") List<LocationDevice> locationDevices);

    /**
     * 根据定位设备名称和编号模糊搜索
     *
     * @param value
     * @return
     */
    List<LocationDevice> selectVagueList(@Param("value") String value);

    List<LocationDevice> selectListDescTime(int pageSize);

    /**
     * 设置基站二维数据
     *
     * @param locationDevice2DDTOS
     * @return void
     * @author ljx
     * @time 2024/10/29 10:55
     */
    void setAnchor2DInfo(@Param("list") List<LocationDevice2DDTO> locationDevice2DDTOS);

    /**z
     * 根据栋数和楼层查询基站设备二维信息
     *
     * @param building
     * @param floor
     * @return java.util.List<com.bsj.power.common.def.vo.pls.Anchor2DInfoVO>
     * @author ljx
     * @time 2024/10/29 11:24
     */
    List<Anchor2DInfoVO> listDevice2DInfo(@Param("building") Integer building, @Param("floor") Integer floor);

    /**
     * 清除基站二维信息
     *
     * @param list
     * @return void
     * @author ljx
     * @time 2024/10/29 14:26
     */
    void cleanAnchor2DInfo(@Param("list") List<String> list);

    /**
     * 批量设置设备别名
     *
     * @param deviceTemplates
     * @return void
     * @author ljx
     * @time 2024/10/29 16:15
     */
    void batchSetNikeName(@Param("list") List<LocationDeviceTemplate> deviceTemplates);

}
